﻿/*  
 *  游戏常用NPC
 *  QQ12796161 
 */


var status = 0;
var eff = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";
var z = "#fEffect/CharacterEff/1112960/3/0#";//"+z+"//美化
var zz = "#fUI/UIPVP.img/ChampionMark/4#";//
var kkk1 = "#fMap/MapHelper.img/weather/thankyou/7#";
var kkk2 = "#fMap/MapHelper.img/weather/starPlanet2/8#";
var kkk = "#fUI/UIPVP.img/MiniMapIcon/star#";
var BOSS = "#fUI/UIWindow2/MobGage/SmartMobnotice/backgrnd#";
var eff1 = "#fEffect/CharacterEff/1112905/0/1#";//小红心
var icon = "#fUI/Basic.img/BtMin2/normal/0#";
var iconEvent = "#fUI/UIToolTip.img/Item/Equip/Star/Star#";
var ttt = "#fUI/UIWindow/Quest/icon2/7#";//"+ttt+"//美化1
var ttt2 = "#fUI/UIWindow/Quest/icon6/7#";////美化2
var ttt3 = "#fUI/UIWindow/Quest/icon3/6#";//"+ttt3+"//美化圆
var ttt4 = "#fUI/UIWindow/Quest/icon5/1#";//"+ttt4+"//美化New
var ttt5 = "#fUI/UIWindow/Quest/icon0#";////美化!
var ttt6 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";//"+ttt6+"//美化会员
var z1 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";//"+z+"//美化
var tt = "#fEffect/ItemEff/1112811/0/0#";//音符
var a = "#fEffect/CharacterEff/1114000/1/0#"; //红色六芒星
var b = "#fEffect/CharacterEff/1003271/0/0#";
var c = "#fEffect/CharacterEff/1112905/0/0#"; //篮心
var d = "#fEffect/CharacterEff/1002667/0/0#"; //黄星
var e = "#fUI/UIPVP.img/MiniMapIcon/star#"; //音乐
var g = "#fEffect/CharacterEff/1082565/0/0#"; //饼干兔子
var h = "#fUI/Basic/BtHide3/mouseOver/0#";
var f = "#fUI/UIPVP.img/MiniMapIcon/star#";//彩色五角星
var feng = "#v4032733#"

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
            cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
            cm.dispose();
        } 
    else if (status == 0) { //
		if (!cm.haveItem(2431305, 1)) {
            //cm.gainItem(2431305, 1);
            //cm.playerMessage(-1, "赠送给你 >>> 火光武器箱 一个，可以根据你的角色等级获取相应的道具！")
        }
		var selStr = ""+zz+""+zz+""+zz+""+zz+""+zz+""+zz+""+zz+"\r\n";
		selStr += "#r#L0#"+kkk+" 返回市场#l";
		//selStr += "\r\n#d#L3#"+kkk+" 万能传送#l  #L4#"+kkk+" BOSS副本#l  #L5#"+kkk+" 杂货商店#l#k";
		//selStr += "\r\n#b#L6#"+kkk+" 福利中心#l  #L7#"+kkk+" 购物商城#l  #L8#"+kkk+" 删除物品#l#k";
		//selStr += "\r\n#r#L16#"+kkk+" 破功中心#l  #L10#"+kkk+" 常用功能#l  #L11#"+kkk+" 掉率查询#l#k";
                //selStr += "\r\n"+epp1+""+epp1+""+epp1+""+epp1+"";
		//selStr += "\r\n#d#L12#"+kkk+" 新手中心#l  #L13#"+kkk+" 中介服务#l  #L14#"+kkk+" 学习技能#l#k\r\n";
		//selStr += "#b#L15#"+kkk+" 充值中心#l  #L9#"+kkk+" 休闲娱乐#l  #L17#"+kkk+" 军衔系统#l#k\r\n";
		//selStr += "\r\n  "+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+""+e+"";
		//selStr += "   #b#L88#"+kkk+" 打开怪怪卡系统#l      #L89#"+kkk+" 打开分解系统#l#k\r\n";
		//selStr += "#e#d#L86#打开充值网站连接:〈1元=1余额〉公测双倍活动中#l\r\n";
		//selStr += "                 #b#L66#"+kkk+" 内测奖励#l \r\n";
                //selStr += "\r\n"+epp+""+epp+""+epp+""+epp+"";
		cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
        case 0: // 自由市场
           if (cm.getPlayer().getMapId() >= 910000000 && cm.getPlayer().getMapId() <= 910000022) {
                    cm.sendOk("你已经在自由市场了。");
                } else {
                    cm.saveReturnLocation("FREE_MARKET");
                    cm.warp(910000000, "st00");
                }
                cm.dispose();
                break;
            case 86://充值
                cm.dispose();
                 //cm.openWeb("http://new.shoukabao.com/Payment/Service/f3957d1a40bfce5ca201e1d2461fd6a5");
                 cm.sendOk("#d已自动为您打开充值链接，请输入账号密码进行充值，请确保账号内有角色到达10级，否则无法收到余额。");
                break;
		case 1: // 快速转职
			cm.dispose();
			cm.openNpc(9310362, "yjwz");
			break;
		case 88: // 快速转职
			cm.dispose();
			cm.openUI(596);
			break;
		case 89: // 快速转职
			cm.dispose();
			cm.openNpc(9310362, "huigou");
			break;
		case 2: // 查询账户
			cm.sendOkN("#e#g当前账户累计充值金为：#b" + cm.getHyPay(3) + " #g元，其它信息为 ：#n#k \r\n#b"+kkk+" 余额：  #g " + cm.getHyPay(1) + " #b元        #b"+kkk+" 废弃积分：  #g " +cm.getPlayerPoints()+ " #b点\r\n#b"+kkk+" 点券：  #g " + cm.getPlayer().getCSPoints(1) + " #b点\r\n"+kkk+" #b抵用券： #g" + cm.getPlayer().getCSPoints(2) + " #b点#k");
			cm.dispose();
			break;
		case 3: // 地图传送
			cm.dispose();
			cm.openNpc(1032005, "worldwarp");
			break;
		case 4://  BOSS传送
			cm.dispose();
			cm.openNpc(2023000, "cszx");
			break;
		case 5: //  杂货店
			cm.dispose();
			cm.openShop(61);
			break
		case 66: //  杂货店
                // cm.gainNX(99999999);
                // cm.addHyPay(-10000);
                // cm.sendOk("成功领取内侧奖励");
			cm.dispose();
			break
		case 6: //  福利中心
			cm.dispose();
			cm.openNpc(9310362, "flzx");
			break;
		case 7: //  商城购物
			cm.dispose();
			cm.openNpc(9310362, "scgw");
			break;
		case 8: //  物品回收
			cm.dispose();
			cm.openNpc(9900000,"Delete");
			break;
		case 9:  //  休闲中心
			cm.dispose();
			cm.openNpc(1012008, "GameCenter");
			break;
		case 10: //  管理中心
			cm.dispose();
			cm.openNpc(9900003, "guanli");
			break;
		case 11: //  爆率查询
			cm.dispose();
			cm.openNpc(9310362, "checkDrop");
			break;
		case 12: //  新手必点
			cm.dispose();
			cm.openNpc(9900005);
			break;
		case 13: //  中介服务
			cm.dispose();
			cm.openNpc(9310362, "41");
			break;
		case 14: //  学习技能
			cm.dispose();
			cm.openNpc(9900003, "xuegoujineng");
			break;
		case 15: //  充值中心
		    cm.dispose();
		    cm.openNpc(9310362, "czfl");
			break;
		case 16: //  破功中心
			cm.dispose();
			cm.openNpc(9310362, "tupo");
			break;
		case 17: //  军衔
			cm.dispose();
			cm.openNpc(9310362, "bfts");
			break;
		case 22: //  兑换中心
			cm.dispose();
			cm.openNpc(9310362, "ncdj");
			break;
		case 23: //  兑换中心
			cm.dispose();
			cm.openNpc(9310362);
			break;
         }
    }
}
